home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / devkit / c / include / cl_text.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-12  |  2.9 KB  |  86 lines

  1. /*
  2.  * Interface: cl_text.library
  3.  *
  4.  * $RCSfile$
  5.  * $Author$
  6.  * $Revision$
  7.  * $Date$
  8.  * $State$
  9.  * $Locker$
  10.  *
  11.  * $Log$
  12.  */
  13.  
  14. #ifndef _CL_TEXT_H
  15. #define _CL_TEXT_H
  16.  
  17. #include <libraries/locale.h>
  18.  
  19. //
  20. // External token replacement list
  21. //
  22.  
  23. typedef struct CLTXT_TokEntry
  24. {
  25.     char *name;        // Name of token (UPPER CASE ONLY!)
  26.     ULONG type;        // Replacement type
  27.     APTR data;        // Data
  28. } CLTXT_TokEntry;
  29.  
  30. //
  31. // Possible types for CLTXT_TokEnts
  32. //
  33.  
  34. #define CLTXT_RT_STRING 0        // Insert Data as a string (max. 1024 chars)
  35. #define CLTXT_RT_INTEGER 1      // Insert Data with %lD
  36. #define CLTXT_RT_UNSIGNED 2        // Insert Data with %lU
  37. #define CLTXT_RT_HOOK 3            // Call Hook (a0 = Hook, a1 = STRPTR to token data, a2 = STRPTR to buffer (must be zero-terminated, max. 1024 chars!)
  38. #define CLTXT_RT_FILE 4            // Data is file to include (max. 1024 chars!)
  39.  
  40.  
  41. // SAS/C pragmas
  42.  
  43. extern struct Library *CLTXTBase;
  44.  
  45. #pragma libcall CLTXTBase CLTXT_ReadPrefs 1e 0
  46. #pragma libcall CLTXTBase CLTXT_OpenLocale 24 801
  47. #pragma libcall CLTXTBase CLTXT_SPrintfA 2a BA9804
  48. #pragma libcall CLTXTBase CLTXT_PrintfA 30 A9803
  49. #pragma libcall CLTXTBase CLTXT_FormatDate 36 BA9804
  50. #pragma libcall CLTXTBase CLTXT_Replace 3c BA9804
  51. #pragma libcall CLTXTBase CLTXT_MakeFile 42 BA9804
  52. #pragma libcall CLTXTBase CLTXT_OpenCatalog 48 9802
  53. #pragma libcall CLTXTBase CLTXT_CloseCatalog 4e 801
  54. #pragma libcall CLTXTBase CLTXT_GetString 54 A9803
  55. #pragma libcall CLTXTBase CLTXT_GetLanguageByDomain 5a 801
  56. #pragma libcall CLTXTBase CLTXT_FlushCatalogs 60 0
  57. #pragma libcall CLTXTBase CLTXT_ReplaceAll 66 B0A9805
  58. #pragma libcall CLTXTBase CLTXT_GetLanguageList 6c 0
  59. #pragma libcall CLTXTBase CLTXT_ViewFile 72 B9803
  60.  
  61. #pragma tagcall CLTXTBase CLTXT_SPrintf 2a BA9804
  62. #pragma tagcall CLTXTBase CLTXT_Printf 30 A9803
  63.  
  64.  
  65. // ANSI prototypes
  66.  
  67. void CLTXT_ReadPrefs( void );
  68. struct Locale *CLTXT_OpenLocale( STRPTR cllangname );
  69. APTR CLTXT_SPrintfA( struct Locale *locale, STRPTR to, STRPTR format, APTR args );
  70. APTR CLTXT_SPrintf( struct Locale *locale, STRPTR to, STRPTR format, ... );
  71. APTR CLTXT_PrintfA( struct Locale *locale, STRPTR format, APTR args );
  72. APTR CLTXT_Printf( struct Locale *locale, STRPTR format, ... );
  73. void CLTXT_FormatDate( struct Locale *locale, STRPTR to, STRPTR format, struct DateStamp *datestamp );
  74. int CLTXT_Replace( struct Locale *locale, STRPTR token, STRPTR to, CLTXT_TokEntry *tokents );
  75. int CLTXT_ReplaceAll( struct Locale *locale, STRPTR src, STRPTR dst, size_t dstlen, CLTXT_TokEntry *tokents );
  76. int CLTXT_MakeFile( STRPTR cllangname, STRPTR textfile, STRPTR tofilename, CLTXT_TokEntry *tokents );
  77. APTR CLTXT_OpenCatalog( STRPTR cllangname, STRPTR catalogname );
  78. void CLTXT_CloseCatalog( APTR clcatalog );
  79. STRPTR CLTXT_GetString( APTR clcatalog, STRPTR stringid, STRPTR defstring );
  80. STRPTR CLTXT_GetLanguageByDomain( STRPTR domainadr );
  81. void CLTXT_FlushCatalogs( void );
  82. STRPTR * CLTXT_GetLanguageList( void );
  83. int CLTXT_ViewFile( STRPTR cllangname, STRPTR textfile, CLTXT_TokEntry *tokents );
  84.  
  85. #endif
  86.